<?php

$this->_toolbar = array(
	'title'		=>	Yii::t('admin_news', 'Pages Manager'),
);
?>
<div class="search-form">
<?php $this->renderPartial('_search', array(
	'model' => $model,
)); ?>
</div><!-- search-form -->

<?php
$this->widget('ext.widgets.iGridView', array(
	'id' => 'pages-grid',
	'dataProvider' => $model->search(),
	'filter' => $model,
	'columns' => array(
		array(
			'name'	=>	'id',
			'htmlOptions'	=>	array(
				'width'	=>	'30',
				'align'	=>	'center'
			),
		),
		array(
			'name'	=>	'page_tree',
			'type'	=>	'raw',
			'value'	=>	'CHtml::link(CHtml::encode($data->page_tree), array("pages/update","id"=>$data->id),array("style"=>"text-decoration:none"))'
		),
		'alias',
		array(
			'name'	=>	'ordering',
			'htmlOptions'	=>	array(
				'width'	=>	'60',
				'align'	=>	'center'
			),
		),
		array(
			'name'	=>	'status',
			'type'	=> 	'raw',
			'value'	=>	'CHtml::image(Yii::app()->theme->baseUrl."/images/icons/".Lookup::item("PostStatus",$data->status).".png",Lookup::item("PostStatus",$data->status), array("title"=>Lookup::item("PostStatus",$data->status)))',
			'htmlOptions'=>array(
				'align'	=>'center',
				'width'	=>'100'
			),
			'filter'=> Lookup::items('PostStatus')
		),
		array(
			'name'	=>	'created_by',
			'value'	=>	'iUsers::model()->findByPk($data->created_by)->username',
			'htmlOptions'	=>	array('align'=>'center')
		),
		/*
		'created',
		'created_by',
		'modified',
		'modified_by',
		'ordering',
		'metakey',
		'metadesc',
		array(
					'name' => 'published',
					'value' => '($data->published == 0) ? Yii::t(\'app\', \'No\') : Yii::t(\'app\', \'Yes\')',
					'filter' => array('0' => Yii::t('app', 'No'), '1' => Yii::t('app', 'Yes')),
					),
		*/
		array(
			'class' => 'CButtonColumn',
		),
	),
)); 
?>